FROM alpine
LABEL AUTHOR="Tiger <ZS5ha2ltb3RvLmFraXJhQGdtYWlsLmNvbQ==>"

ENV DEFAULT_LIST_FILE=crontab_list.sh \
    CUSTOM_LIST_MERGE_TYPE=append \
    COOKIE_LIST=/data/cookies.list \
    GEN_CODE_LIST=/data/genCodeConf.list \
    LOGS_DIR=/data/logs \
    DDBOT_VER=0.5

RUN set -ex \
    && apk update && apk upgrade\
    && apk add --no-cache tzdata git \
    && apk add --update python3-dev py3-pip \
    && ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
    && echo "Asia/Shanghai" > /etc/timezone \
    && mkdir /jds \
    && cd  /jds \
    && git init \
    && git remote add -f origin https://gitee.com/xiangtailiang/my-jd-docker.git \
    && git config core.sparsecheckout true \
    && git pull origin master \
    && cp /jds/docker_entrypoint.sh /usr/local/bin \
    && cp /jds/bot/ddBot-amd64 /usr/local/bin/ddBot \
    && chmod +x /usr/local/bin/docker_entrypoint.sh \
    && chmod +x /usr/local/bin/ddBot 

RUN mkdir /scripts \
    && cd  /scripts \
    && git init \
    && git remote add -f origin https://github.com/shufflewzc/faker2.git \
    && git config core.sparsecheckout true \
    && git pull origin main 

WORKDIR /scripts

ENTRYPOINT ["docker_entrypoint.sh"]

CMD [ "crond" ]
